# 1.
# names=['zhao','qian','sun','li']
# a=input("请输入一个姓：")
# if a in names:
#     print("该姓已存在") 
# else:
#     names.append(a)
#     print("添加成功")
# print(names)

# 2.
# nums=[6,5,3,1,8,7,2,4]
# for i in range(len(nums)-1):
#     for j in range(len(nums)-1-i):
#         if nums[j+1]>nums[j]:
#             nums[j],nums[j+1]=nums[j+1],nums[j]
# print(nums)

# 3.
# nums=[3,1,9,8,4,2,0,7,5]
# print("最大值为：",max(nums))
# print("下标为：",nums.index(max(nums)))

# 4.
# x=['hello','good',' ','yes',' ']
# for i in x:
#     if ' ' in x:
#         x.remove(' ')
# print(x)
